package com.primestone.cim.client.app.window;

import com.primestone.cim.client.business.WindowConstants;

/**
 * 
 * @author cesar.mateus
 * Jul 22, 2013 9:32:45 PM
 * LongRunningOperationParam.java
 * CIMClientApplication
 *
 */
public class LongRunningOperationParam {
	
	private String socket;
	private String device;
	private String vartypeRequest;
	private int yearIni;
	private int monthIni; 
	private int dayIni;
	private int yearEnd; 
	private int monthEnd; 
	private int dayEnd;
	private boolean isM; 
	private boolean isR;
	private boolean isV;
	private int top; 
	private boolean onlyNew;	
	private String descvar;

	/**
	 * 
	 * @param window
	 */
	public LongRunningOperationParam(CIMApplicationWindow window) {
		super();
		this.socket = window.getBtnSocket().getSelection() ? window.getSocketOrDeviceText().getText() : null;
		this.device = window.getBtnDevice().getSelection() ? window.getSocketOrDeviceText().getText() : null;

		this.descvar = window.getVarText().getText();

		this.vartypeRequest = new StringBuilder(
				window.getBtnMassmemory().getSelection() ? "M" : WindowConstants.EMPTY)
		.append(window.getBtnRegisters().getSelection() ? "R" : WindowConstants.EMPTY)
		.append(window.getBtnEvents().getSelection() ? "V" : WindowConstants.EMPTY)
		.toString();

		this.yearIni = window.getIniDate().getYear();
		this.monthIni = window.getIniDate().getMonth(); 
		this.dayIni = window.getIniDate().getDay();
		this.yearEnd = window.getEndDate().getYear(); 
		this.monthEnd = window.getEndDate().getMonth(); 
		this.dayEnd = window.getEndDate().getDay();

		this.isM = window.getBtnMassmemory().getSelection(); 
		this.isR = window.getBtnRegisters().getSelection();
		this.isV = window.getBtnEvents().getSelection();

		this.top = window.getSpinnerTop().getSelection(); 
		this.onlyNew = window.getBtnOnlyNew().getSelection();
	}

	/**
	 * @return the socket
	 */
	public String getSocket() {
		return this.socket;
	}

	/**
	 * @param socket the socket to set
	 */
	public void setSocket(String socket) {
		this.socket = socket;
	}

	/**
	 * @return the device
	 */
	public String getDevice() {
		return this.device;
	}

	/**
	 * @param device the device to set
	 */
	public void setDevice(String device) {
		this.device = device;
	}

	/**
	 * @return the vartypeRequest
	 */
	public String getVartypeRequest() {
		return this.vartypeRequest;
	}

	/**
	 * @param vartypeRequest the vartypeRequest to set
	 */
	public void setVartypeRequest(String vartypeRequest) {
		this.vartypeRequest = vartypeRequest;
	}

	/**
	 * @return the yearIni
	 */
	public int getYearIni() {
		return this.yearIni;
	}

	/**
	 * @param yearIni the yearIni to set
	 */
	public void setYearIni(int yearIni) {
		this.yearIni = yearIni;
	}

	/**
	 * @return the monthIni
	 */
	public int getMonthIni() {
		return this.monthIni;
	}

	/**
	 * @param monthIni the monthIni to set
	 */
	public void setMonthIni(int monthIni) {
		this.monthIni = monthIni;
	}

	/**
	 * @return the dayIni
	 */
	public int getDayIni() {
		return this.dayIni;
	}

	/**
	 * @param dayIni the dayIni to set
	 */
	public void setDayIni(int dayIni) {
		this.dayIni = dayIni;
	}

	/**
	 * @return the yearEnd
	 */
	public int getYearEnd() {
		return this.yearEnd;
	}

	/**
	 * @param yearEnd the yearEnd to set
	 */
	public void setYearEnd(int yearEnd) {
		this.yearEnd = yearEnd;
	}

	/**
	 * @return the monthEnd
	 */
	public int getMonthEnd() {
		return this.monthEnd;
	}

	/**
	 * @param monthEnd the monthEnd to set
	 */
	public void setMonthEnd(int monthEnd) {
		this.monthEnd = monthEnd;
	}

	/**
	 * @return the dayEnd
	 */
	public int getDayEnd() {
		return this.dayEnd;
	}

	/**
	 * @param dayEnd the dayEnd to set
	 */
	public void setDayEnd(int dayEnd) {
		this.dayEnd = dayEnd;
	}

	/**
	 * @return the isM
	 */
	public boolean isM() {
		return this.isM;
	}

	/**
	 * @param isM the isM to set
	 */
	public void setM(boolean isM) {
		this.isM = isM;
	}

	/**
	 * @return the isR
	 */
	public boolean isR() {
		return this.isR;
	}

	/**
	 * @param isR the isR to set
	 */
	public void setR(boolean isR) {
		this.isR = isR;
	}

	/**
	 * @return the isV
	 */
	public boolean isV() {
		return this.isV;
	}

	/**
	 * @param isV the isV to set
	 */
	public void setV(boolean isV) {
		this.isV = isV;
	}

	/**
	 * @return the top
	 */
	public int getTop() {
		return this.top;
	}

	/**
	 * @param top the top to set
	 */
	public void setTop(int top) {
		this.top = top;
	}

	/**
	 * @return the onlyNew
	 */
	public boolean isOnlyNew() {
		return this.onlyNew;
	}

	/**
	 * @param onlyNew the onlyNew to set
	 */
	public void setOnlyNew(boolean onlyNew) {
		this.onlyNew = onlyNew;
	}

	/**
	 * @return the descvar
	 */
	public String getDescvar() {
		return this.descvar;
	}

	/**
	 * @param descvar the descvar to set
	 */
	public void setDescvar(String descvar) {
		this.descvar = descvar;
	}
	
	
}
